package com.ivg.controller;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.ivg.entity.User;
import com.ivg.util.JwtUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;


/**
 * 用户登录授权测试
 */
@RestController
@Slf4j
public class UserController {

    private ObjectMapper objectMapper;

    /**
     * 登陆认证接口
     * @param user
     * @return
     */
    @PostMapping("/v1/login")
    public String login(@RequestBody User user) {
        log.info("login user");
        return  JwtUtil.createJWT(100000000, user);
    }

}
